﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kators.Services
{
    public class ControlsService
    {
        public static void SetControls(Control container, string targetControl, bool enable)
        {
            foreach (Control c in container.Controls)
            {
                SetControls(c, targetControl, enable);
                if (c.GetType().Name == targetControl) c.Enabled = enable;

            }
        }

        public static void SetAllControls(Control container,bool enable)
        {
            foreach (Control c in container.Controls)
            {
                SetAllControls(c,enable);
                c.Enabled = enable; 
            }
        }
      
       


    }
}
